package net.adetech.crj.service;

import net.adetech.crj.dao.AppointmentMapper;
import net.adetech.crj.entity.Appointment;
import net.adetech.crj.utils.InnerServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("appointment.getById")
public class GetAppointmentByIdService implements BaseService {
    @Autowired
    AppointmentMapper appointmentMapper;
    @Override
    public Map<String, Object> invoke(Map<String, Object> params) {
        String appointmentId = (String)params.get("appointmentId");
        Appointment appointment = appointmentMapper.getAppointmentById(appointmentId);
        return InnerServiceUtil.buildResult("appointment",appointment);
    }
}
